package com.jason.jasonapp.tools;

import com.jason.jasonapp.MainActivity;

import android.telephony.PhoneStateListener;
import android.telephony.SignalStrength;

public class JasonPhoneStateListener extends PhoneStateListener {
	
	private MainActivity activity;
	public JasonPhoneStateListener(MainActivity activity)
	{
		this.activity = activity;
	}
	
	@Override
	public void onSignalStrengthsChanged(SignalStrength signalStrength)
    {
       super.onSignalStrengthsChanged(signalStrength);
       activity.printSignalStrength(signalStrength);
       /*Toast.makeText(getApplicationContext(), "Go to Firstdroid!!! GSM Cinr = "
          + String.valueOf(signalStrength.getGsmSignalStrength()), Toast.LENGTH_SHORT).show();*/
    }
	
	public static int AsuToRssi(int asu)
	{
		if(asu >= 0 && asu < 32)
			return 2*asu - 113;
		return 0;
	}

}
